Add a setting for dialog headers
authorMatthias Clasen <mclasen@redhat.com>
Wed, 15 Jan 2014 05:33:30 +0000 (00:33 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 17 Jan 2014 22:52:08 +0000 (17:52 -0500)
This setting will let us keep traditional appearance
of dialogs on platforms where this is expected.
The new setting is called gtk-dialogs-use-header, backed
by the Gtk/DialogsUseHeader xsetting.

gdk/x11/gdksettings.c
gtk/gtksettings.c

index ac92cca833b67859bc35f744ccc5cc7127b8ea4d..86ecc2dfece1f9e256e607330ab8f4b95b3d79a8 100644 (file)
@@ -59,6 +59,7 @@ static const struct {
   {"Gtk/ShellShowsMenubar",   "gtk-shell-shows-menubar"},
   {"Gtk/ShellShowsDesktop",   "gtk-shell-shows-desktop"},
   {"Gtk/DecorationLayout",    "gtk-decoration-layout"},
+  {"Gtk/DialogsUseHeader",    "gtk-dialogs-use-header"},
   {"Gtk/EnablePrimaryPaste",  "gtk-enable-primary-paste"},
   {"Gtk/RecentFilesMaxAge",   "gtk-recent-files-max-age"},
   {"Gtk/RecentFilesEnabled",  "gtk-recent-files-enabled"},
index 3c74274286f22c1ed1dbf360779a2bf2c8264e56..4bf0e9bd7c13e8409f0f9742a510ced977a0b6bb 100644 (file)
@@ -215,6 +215,7 @@ enum {
   PROP_SHELL_SHOWS_MENUBAR,
   PROP_SHELL_SHOWS_DESKTOP,
   PROP_DECORATION_LAYOUT,
+  PROP_DIALOGS_USE_HEADER,
   PROP_ENABLE_PRIMARY_PASTE,
   PROP_RECENT_FILES_ENABLED
 };
@@ -1575,6 +1576,27 @@ gtk_settings_class_init (GtkSettingsClass *class)
                                              NULL);
   g_assert (result == PROP_DECORATION_LAYOUT);
 
+  /**
+   * GtkSettings:gtk-dialogs-use-header:
+   *
+   * Whether builtin GTK+ dialogs such as the file chooser, the
+   * color chooser or the font chooser will use a header bar at
+   * the top to show action widgets, or an action area at the bottom.
+   *
+   * This setting does not affect custom dialogs using GtkDialog
+   * directly, or message dialogs.
+   *
+   * Since: 3.12
+   */
+  result = settings_install_property_parser (class,
+                                             g_param_spec_boolean ("gtk-dialogs-use-header",
+                                                                   P_("Dialogs use header bar"),
+                                                                   P_("Whether builtin GTK+ dialogs should use a header bar instead of an action area."),
+                                                                   FALSE,
+                                                                   GTK_PARAM_READWRITE),
+                                             NULL);
+  g_assert (result == PROP_DIALOGS_USE_HEADER);
+
   /**
    * GtkSettings:gtk-enable-primary-paste:
    *